package Java继承;

public class Teacher4 extends Staff4 {
    private int teachingAge; // 教龄

    public Teacher4(String id, String name, String gender, double salary, int teachingAge) {
        super(id, name, gender, salary);
        this.teachingAge = teachingAge;
    }

    @Override
    public void work() {
        System.out.println("从事教学工作，教龄" + teachingAge + "年");
    }
}